//
//  ModelParser.h
//  ModelParser
//
//  Created by JackAndney on 2018/1/2.
//  Copyright © 2018年 Andney. All rights reserved.
//

#import <Foundation/Foundation.h>
@protocol ModelParserDelegate;



/**
 *  Model解析类
 */
@interface ModelParser : NSObject

/** JSON字符串 */
@property (nonatomic, copy) NSString *jsonString;
/** JSON字典 */
@property (nonatomic, copy) NSDictionary *jsonDict;

/** 类名 */
@property (nonatomic, copy) NSString *className;
/** 替换key为id的键值 */
@property (nonatomic, copy) NSString *replaceKeyForId;

/** 是否按照字符串中的key值顺序输出 */
@property (nonatomic, assign) BOOL sortedByOrderInString; // 默认为YES
/** 是否添加注释 */
@property (nonatomic, assign) BOOL addComment;  // 默认为YES
/** 是否添加.m实现部分 */
@property (nonatomic, assign) BOOL addImplementationPart; // 默认为YES

@property (nonatomic, weak) id<ModelParserDelegate> delegate;
@property (nonatomic, copy) void (^completionBlock)(BOOL success, NSString *result);

/** 开始解析 */
- (BOOL)startParse;


@end


void MYLOG(id obj);


#pragma mark -


@protocol ModelParserDelegate <NSObject>

- (void)parser:(ModelParser *)parser didCompleteWithResult:(NSString *)result;
- (void)parser:(ModelParser *)parser didFailWithError:(NSString *)error;

@end